window.onload = function (){
    var errInfo = getQuery("errorInfo")
    if (errInfo != null && errInfo == "noCustom"){
        $('errorInfo').innerHTML = "请以顾客身份登录"
    }
}
function login(){
    axios.get("/user/login",{
        params:{
            username:$('username').value,
            pwd:$('pwd').value
        }

    }).then(resp =>{
        var info = resp.data
        if (info != ""){
            if (info.grade == "顾客"){
                location.href = "/index.html"
            }
            else if (info.grade == "管理员"){
                location.href = "/manager/selectOrder.html"
            }
            else{
                location.href = "/send/send.html"
            }
        }
        else {
            $('errorInfo').innerHTML = "登录失败"
        }


    })

}